package com.sunkyc.module.book.job;


import com.alibaba.druid.pool.DruidDataSource;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.sql.SQLException;

@Component
@Slf4j
@RequiredArgsConstructor
public class BookJobHandler {


    private final DruidDataSource dataSource;


    @XxlJob("testJobOne")
    public void testJobOne() throws SQLException {
        log.info("我执行了定时任务:{}","testJobOne");
        ScriptRunner runner = new ScriptRunner(dataSource.getConnection());


    }


    @XxlJob("testJobTwo")
    public void testJobTwo(){
        log.info("我执行了定时任务:{}","testJobTwo");
    }


}
